package cn.schoolwow.util.test.module.beanCopy.testcase;

import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import cn.schoolwow.util.domain.beanCopy.BeanCopy;
import cn.schoolwow.util.test.module.beanCopy.domain.UserExtend;
import cn.schoolwow.util.test.module.common.domain.User;
import org.junit.Assert;

public class CopyPropertiesTestCaseFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        User user = new User();
        user.username = "zhangsan";
        user.password = "123456";

        UserExtend userExtend = new UserExtend();
        BeanCopy.copyProperties(user, userExtend);

        Assert.assertEquals(userExtend.username, user.username);
        Assert.assertEquals(userExtend.password, user.password);
    }

    @Override
    public String name() {
        return "Bean复制属性测试用例";
    }
}
